import React, { useReducer } from "react";
const reducer = (prevState, action) => {
  console.log("时间点点", prevState, action);
  //不能直接修改prevState 重新赋值来操作
  let newState={...prevState}
  switch (action.type) {
    case 'iaoziqiao':
        
        break;
  
    default:
        break;
  }
};

const intialState = {
  count: 0,
};
export default function App() {
  const [state, dispatch] = useReducer(reducer, intialState);
  return (
    <div>
      13-useReducer学习
      <button
        onClick={() => {
          dispatch({ type: "liaoziqiao" });
        }}
      >
        -
      </button>
      {state.count}
      <button
        onClick={() => {
          dispatch({ type: "liaoziqiao-add" });
        }}
      >
        +
      </button>
    </div>
  );
}
